package com.java.digitalsignagesystem.entity;

public enum TimeRange {
    LAST_24_HOURS(1),
    LAST_WEEK(2),
    LAST_MONTH(3),
    LAST_MONTH6(4),
    LAST_NULL(0);

    private final int value;

    private TimeRange(Integer value) {
        this.value = value;
    }

    public int getValue() {
        return value;
    }
    public static TimeRange valueOf(int value) {
        for (TimeRange timeRange : TimeRange.values()) {
            if (timeRange.value == value) {
                return timeRange;
            }
        }
        throw new IllegalArgumentException("Invalid time range value: " + value);
    }
}
